<?php
namespace Home\Controller;
use Think\Controller;
class AdminerController extends CommonController {
    public function index(){
            $m = M("admin");
            $arr = $m->find(1);
            $this->assign("arr",$arr);
            $this->display();
    }

    public function doUpdate(){
        $pass1 = $_POST['pass1'];
        $pass2 = $_POST['pass2'];
        if($pass1 != $pass2 || $pass2 == '' || $pass1 == ''){
            $this->error("认真填写");
        }else{
            $data['password']= md5($pass2);
            $m = M("admin");
            $result = $m->where("id = 1")->save($data);
            $this->myRelust($result);
        }
    }



}
